﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using ZLDC.Common.Estate;

namespace ZLDC.Estate.Page
{
    public partial class Desk1 : ZLDC.Common.Estate._PageBase
    {
        public string work = "团队工作";
        protected void Page_Load(object sender, EventArgs e)
        {
            //是否业务员
            if (ZLDC.Topo.BLL.Estate.lp_Basis.GetStationhz(_Utility.GetInfoBySession().m_sStation))
            {
               
                work = "我的工作";
            }

            if (!IsPostBack)
            {
                userid.Value = this.info.m_sUserID;

                DataTable dt = null;
                using (_Database db = new _Database("estate"))
                {
                    dt = ZLDC.DAL.Estate.NewsDAL.p_list_news(" where ispop=1", db);
                }

                if (dt.Rows.Count > 0)
                {
                    int popNewsId = Convert.ToInt32(dt.Rows[0]["id"].ToString());
                    string know = ZLDC.Common.Estate._Cookie.GetCookie("Iknownews_" + popNewsId + "_" + this.info.m_sUserID);
                    if (know == null || know != "yes")
                    {
                        System.Web.UI.ScriptManager.RegisterClientScriptBlock(this, GetType(), "ajs", "window.open('../../TM/NewsDetails.aspx?id=" + popNewsId + "', '', 'left=0,top=0,height=500,width=800,menubar=no,location=no,resizable=yes,scrollbars=yes');", true);
                    }

                }

                hTodayWork.Value = ZLDC.Common.Estate._Cookie.GetCookie("TodayWorks");

            }
        }


    }
}
